function checkLogin() {
    const loggedinuser = localStorage.getItem("loggedinUser");
    if(!loggedinuser)
    {
        alert("You are not logged in. You must be to view this page.");
        window.location.href = "../login.html";
    }
} 
checkLogin();